import java.io.*;

/**
 * Created by Administrator on 2016/9/21.
 */
public class ReadFileLine {
    public static void main(String[] args){
        File file = new File("D://taobao/car.txt");
        BufferedReader bufferedReader = null ;
        try {
            bufferedReader   = new BufferedReader(new InputStreamReader(new FileInputStream(file),"gbk"));
            int i = 0  ;
            String line = null ;
            while((line = bufferedReader.readLine()) != null){
                //System.out.println(i+":"+line);
                System.out.println("INSERT INTO car_brand(`NAME`) VALUES('"+line+"');") ;
                i++;
            }
            System.out.println(i);
            bufferedReader.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
